package com.wys.mall.cart.config;

import com.wys.mall.cart.interceptor.CartInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 视图跳转
 * @Package com.wys.mall.auth.config
 * @Author charlin
 * @Version: v1.0
 * @Date 2021-07-0513:13
 * @Copyright: 2021 www.wyscha.com Inc. All rights reserved.
 */
@Configuration
public class MallWebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**");
    }

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //登录跳转
//        registry.addViewController("/login.html").setViewName("login");
//        registry.addViewController("/cartList.html").setViewName("cart");
    }
}
